<!--{template header}-->

<!--{if $_GET['op'] == 'edit'}-->

<div id="$pid" <!--{if !$_SGLOBAL[inajax]}-->class="inpage"<!--{else}-->class="inajax"<!--{/if}-->>
	<!--{if $_SGLOBAL[inajax]}-->
		<h1>编辑</h1>
		<a href="javascript:hideMenu();" class="float_del" title="关闭">关闭</a>
		<div class="popupmenu_inner">
	<!--{/if}-->
	<form id="postform" name="postform" method="post" action="cp.php?ac=thread&op=edit&pid=$pid">
		<table>
			<!--{if $post['isthread']}-->
			<tr>
				<th width="60"><label for="subject">标题：</label></th>
				<td><input type="text" class="t_input" id="subject" name="subject" value="$thread[subject]" size="30" /></td>
			</tr>
			<!--{/if}-->
			<tr>
				<th style="vertical-align: top;"><label for="message">内容：</label></th>
				<td>
					<img src="image/zoomin.gif" onmouseover="this.style.cursor='pointer'" onclick="zoomTextarea('message', 1)">
					<img src="image/zoomout.gif" onmouseover="this.style.cursor='pointer'" onclick="zoomTextarea('message', 0)"><br/>
					<textarea id="message" name="message" cols="70" onkeydown="ctrlEnter(event, 'posteditsubmit_btn');" rows="8">$post[message]</textarea>
				</td>
			</tr>
			<tr>
				<th><label for="pic">图片：</label></th>
				<td><input id="pic" class="t_input" type="text" name="pic" value="$post[pic]" size="50" /></td>
			</tr>
			<tr>
				<th>&nbsp;</th>
				<td>
				<input type="hidden" name="refer" value="$_SGLOBAL[refer]" />
				<input type="hidden" name="posteditsubmit" value="true" />
				<!--{if $_SGLOBAL[inajax]}-->
				<input type="button" name="posteditsubmit_btn" id="posteditsubmit_btn" value="提交" class="submit" onclick="ajaxpost('postform', '$pid', 'post_edit')" />&nbsp;
				<!--{else}-->
				<input type="submit" name="posteditsubmit_btn" id="posteditsubmit_btn" value="提交" class="submit" />&nbsp;
				<!--{/if}-->
				</td>
			</tr>
		</table>
	</form>
	<!--{if $_SGLOBAL[inajax]}--></div><!--{/if}-->
</div>

<!--{elseif $_GET['op'] == 'delete'}-->

<div id="$pid" <!--{if !$_SGLOBAL[inajax]}-->class="inpage"<!--{/if}-->>
<form id="postform" name="postform" method="post" action="cp.php?ac=thread&op=delete&pid=$pid">
	<h1>确定删除指定的帖子吗？</h1>
	<p class="btn_line">
		<input type="hidden" name="refer" value="$_SGLOBAL[refer]" />
		<!--{if $_SGLOBAL[inajax]}-->
		<input type="hidden" name="postdeletesubmit" value="true" />
		<input type="button" name="postdeletesubmit_btn" value="提交" class="submit" onclick="ajaxpost('postform', '$pid', 'post_delete')" />&nbsp;
		<button name="btncancel" type="button" class="button" onclick="hideMenu()">取消</button>
		<!--{else}-->
		<input type="submit" name="postdeletesubmit" value="提交" class="submit" />&nbsp;
		<!--{/if}-->
	</p>
</form>
</div>

<!--{elseif $_GET['op'] == 'reply'}-->

<div id="$post[pid]" <!--{if !$_SGLOBAL[inajax]}-->class="inpage"<!--{else}-->class="inajax"<!--{/if}-->>
<!--{if $_SGLOBAL[inajax]}-->
	<h1>回复</h1>
	<a href="javascript:hideMenu();" class="float_del" title="关闭">关闭</a>
	<div class="popupmenu_inner">
<!--{/if}-->
<form id="postform" name="postform" method="post" action="cp.php?ac=thread">
	<table>
		<tr>
			<th><label for="message">内容：</label></th>
			<td>

				<img src="image/zoomin.gif" onmouseover="this.style.cursor='pointer'" onclick="zoomTextarea('message', 1)">

				<img src="image/zoomout.gif" onmouseover="this.style.cursor='pointer'" onclick="zoomTextarea('message', 0)"><br/>

				<textarea id="message" name="message" onkeydown="ctrlEnter(event, 'postsubmit');" rows="8" cols="70"></textarea>

			</td>
		</tr>
		<tr>
			<td>图片链接：</td>
			<td><input id="pic" type="text" name="pic" value="http://" size="30" /></td>
		</tr>
		<tr>
			<td>&nbsp;</td>
			<td>
				<input type="hidden" name="refer" value="$_SGLOBAL[refer]" />
				<input type="hidden" name="tid" value="$post[tid]" />
				<input type="hidden" name="pid" value="$post[pid]" />
				<!--{if $_SGLOBAL[inajax]}-->
				<input type="hidden" name="postsubmit" value="true" />
				<input type="button" name="postsubmit_btn" id="postsubmit" value="回复" class="submit" onclick="ajaxpost('postform', '$post[pid]', 'post_add')" />
				<!--{else}-->
				<input type="submit" name="postsubmit" id="postsubmit" value="回复" class="submit" />
				<!--{/if}-->
			</td>
		</tr>
	</table>
</form>
<!--{if $_SGLOBAL[inajax]}--></div><!--{/if}-->
</div>

<!--{else}-->
<div class="h_status"><h1>发起新话题</h1></div>

<div class="d_content">
<form method="post" action="cp.php?ac=thread&op=" <!--{if !$tagid}-->onsubmit="return validate();"<!--{/if}-->>
<table cellspacing="4" cellpadding="4" width="100%">
<!--{if !$tagid}-->
	<tr>
		<th><label for="subject">选吧：</label></th>
		<td>
		<select name="tagid" id="tagid">
		<!--{loop $mtaglist $fieldid $values}-->
			<option value="" style="color:#CCCCCC;">{$_SGLOBAL[profield][$fieldid][title]}</option>
		<!--{loop $values $value}-->
			<option value="$value[tagid]"> &nbsp;&nbsp;&nbsp;&nbsp; $value[tagname]</option>>
		<!--{/loop}-->	
		<!--{/loop}-->
		</select>
		<script type="text/javascript">
		<!--
			function validate() {
				if($('tagid').value == '') {
					alert('请选择话题对应的选吧名称');
					return false;
				}
				return true;
			}
		//-->
		</script>
		</td>
	</tr>
<!--{else}-->
	<tr>
		<th><label for="subject">选吧：</label></th>
		<td>$mtag[tagname] [<a href="cp.php?ac=thread">切换</a>]</td>
	</tr>
<!--{/if}-->
	<tr>
		<th><label for="subject">标题：</label></th>
		<td><input type="text" class="t_input" id="subject" name="subject" value="" size="60" /></td>
	</tr>
	<tr>
		<th><label for="message">内容：</label></th>
		<td><textarea id="message" name="message" onkeydown="ctrlEnter(event, 'btnsubmit');" style="width:98%;" rows="10"></textarea></td>
	</tr>
	<tr>
		<th><label for="pic">图片：</label></th>
		<td><input id="pic" class="t_input" type="text" name="pic" value="http://" size="40" /> (只支持 .jpg、.gif、.png为结尾的URL地址)</td>
	</tr>
	<tr>
		<th>&nbsp;</th>
		<td><!--{if $tagid}--><input type="hidden" name="tagid" value="$tagid" /><!--{/if}-->
		<input type="hidden" name="threadsubmit" value="true" />
		<input type="submit" name="btnsubmit" id="btnsubmit" value="发起话题" class="submit" /></td>
	</tr>
</table>
</form>
</div>

<!--{/if}-->
<!--{template footer}-->